<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/common.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../css/templet.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../fonts/font-awesome.min.css?01_38" />
		<link rel="stylesheet" type="text/css" href="../mui/css/mui.css?01_38" />
		<!--公共js-->
		<script type="text/javascript" src="../common/js/jquery.js?01_38"></script>
		<!--插件-->
		<script type="text/javascript" src="../common/js/vue.min.js?01_38"></script>
		<script type="text/javascript" src="../common/js/mui.min.js?01_38"></script>
		<script type="text/javascript" src="../common/js/jquery-validate.js?01_38"></script>
		
		<script type="text/javascript" src="../common/js/fastclick.js?01_38"></script>
		<script type="text/javascript" src="../common/js/common.js?01_38"></script>
		<script type="text/javascript" src="../common/js/my_common.js?01_38"></script>
		<script type="text/javascript" src="../common/js/main.js?01_38"></script>
		<script type="text/javascript" src="../common/js/app.js?01_38"></script>
		<style>
			.aaa {
				transform: rotateX(180deg)
			}
			#aaa {
				transition: 0.8s all;
				position: absolute;
				right: 10px;
			}
			.f-25{font-size: 25px;}
		</style>
	</head>
	<body>
		<div id="app" class="wrap_body login pr" v-cloak>
			<!--语言切换-->
			<div class="pad-t-30">
				<div class="language col-sm-3">
					<div id="bbb" @click="sle_lag1" class="fiex">
						<div style="min-width: 48px;" class="pad-r-10 pad-l-10 pad-t-5 pad-b-5 f-12">{{lag}}
						</div>
						<div id="aaa" :class="{'aaa':sel_show!=0}">
							<img src="../images/pull_down.png" class="pad-t-8 mag-l-5 pull_img" />
						</div>
					</div>
					<ul v-show="sel_show!=0" class="pop bg-fff f-12" style="display: block;">
						<li v-for="list in global_lange_config" @click="sel_lag(list.val)" style="">{{list.name}}</li>
					</ul>
				</div>
			</div>
			<!--登录部分-->
			<div class="wrap pad-l-35 pad-r-35 pad-t-65">
				<p class="f-25">{{b_lg['1192']}}</p>
				<p class="mag-t-20 phone_n cf"><input type="tel" v-model="forms.username" name="" id="" :placeholder="b_lg[1003]" class="col-sm-12 pad-b-20 pad-t-20 f-16 required" data-valid="isNonEmpty" :data-error="b_lg[1123]" /></p>
				<p class="mag-t-15 psd cf" style="position: relative;"><input type="password" v-model="forms.password" name="" id="" :placeholder="b_lg[1004]" class="col-sm-12 pad-b-20 pad-t-20 f-16 required" data-valid="isNonEmpty" :data-error="b_lg[1004]" /><span style="width: 30px; height: 30px;position: absolute; top: 21px; right: 13px;" class="000 pa delete_msg" @click="clear_password()" v-show='forms.password.length>=2'></span></p>
				<!--错误提示-->
				<div class="error-box pad-t-10 red center mag-t-10" style="height:10px;" id="errortip">
					<span class="mag-r-5 "></span>
				</div>
				<p class="mag-t-20 center">
					<a href="javascript:jum('enterPhoneNumber.html')" class="red9 f-15 bk">{{b_lg['1005']}}？</a>
				</p>
				<p class="mag-t-30 fff center">
					<a @click="sub_form" href="javascript:;" class="pad-l-100 pad-r-100 fff bg-red9 pad-t-15 pad-b-15 login_btn btn">{{b_lg['1001']}}</a>
				</p>
				<p class="mag-t-35 center f-13">{{b_lg['1193']}}？
					<a href="javascript:jum('register.html')" class="red9">{{b_lg['1194']}}</a>
				</p>
			</div>
		</div>
		<script>
			//当前页面禁止拖动
			$("#app").on("touchmove", function(e) {
				e.preventDefault();
			});

			function fun1() {
				var log = getQueryString("href")
				if(isAPP) {
					And_back("no")
					ws = plus.webview.currentWebview();
					ws.setStyle({
						'popGesture': 'none'
					});
				}
				//表单验证
				$('#app').validate({
					selectID: "#errortip" //指定弹出位置
				});
				//创建vue
				var app = new Vue({
					el: "#app",
					data: {
						txt: "+60", //区号的文字
						forms: { //传输的数据
							username: "", //手机号
							password: "" //密码
						},
						lag: global_lange_config[getItem('lg')].name, //已经选择的语言
						sel_show: "0", //下拉选择框选择与隐藏 0:隐藏 1:显示
						b_lg: global_lange, //语言包
						clear_img: "0"
					},
					methods: {

						sub_form: function() { //表单提交
							if(isAPP){
								app.forms.uuid = getItem("uuid");
							}else{
								app.forms.uuid = "866982030752101,866982030752119"
							}
							
							//							app.forms.gpush_clientid = getItem("gpush_clientid")
							//							app.forms.gpush_token = getItem("gpush_token")
							if(isAPP) {
								var info_plus = plus.push.getClientInfo();
								if(info_plus.clientid == null) {
									app.forms.gpush_clientid = ""
								} else {
									app.forms.gpush_clientid = info_plus.clientid
								}
								if(info_plus.token == null) {
									app.forms.gpush_token = ""
								} else {
									app.forms.gpush_token = info_plus.token
								}

							}
							if($("#app").validate('submitValidate')) { //登录
								console.log("app.forms", app.forms)
								common_ajax("1", app.forms, "member_app_login", function(h) {
									if(h.status == 1) {
										setItem("page_admin", "1")
										setItem("my_msg", JSON.stringify(h.result));
										//设置登陆状态 0:未登录 1:登录
										setItem("login_sta", "1");
										//登录成功后缓存头信息
										setItem("encode", h.result.encode);
										//成功后跳转到首页
										if(navigator.userAgent.match(/Html5Plus/i)) {
											setItem("shop_ver", -1000)
											plus.runtime.restart() //重启app
										} else {
											clicked("../work/index.html")
										}

									} else {
										mui.toast(h.msg);
									}
								})
							}
						},
						sel_lag: function(h) {
							lang(h, function(t) {
								app.b_lg = t;
								app.lag = global_lange_config[getItem('lg')].name;
							});
							app.sel_show = 0; //隐藏语言选择框
						},
						sle_lag1: function() {
							var th = this
							if(th.sel_show == 1) {
								th.sel_show = 0
							} else {
								th.sel_show = 1
							}
						},
						clear_password: function() {
							app.forms.password = ""
						}
					}
				})
			}
		</script>
	</body>

</html>
